<?php defined('SYSPATH') OR die('No direct access allowed.');
$per_page = Kohana::config('forum.per_page.comments');?>
<UL class="list usercomments">
	<LI class="header">
		<P class="title"><?=Kohana::lang('members.comments.title')?> (<?=Kohana::lang('members.comments.count')?> <?=$pages->total_items?>)</P>
		<?=$pages?>
	</LI>
	<?foreach($comments as $comment):
	$page = ceil($comment->in_post_number/$per_page);
	$post = text::limit_chars($comment->post->title, 20);
	$post_url = Router::uri('forum', array('controller'=>'post', 'method'=>$comment->post_id));
	?>
	<LI>
		<DL class="rounded">
			<DT>
				<SPAN class="leftside ts">
					<?=cmsformat::timestamp('forum.post', $comment->created)?> |
					<?=html::anchor($post_url."?page=".$page."#comment_".$comment->id, '#', array('title' => Kohana::lang('members.comments.permalink')))?>
				</SPAN>
				<SPAN class="rightside">
					<?=Kohana::lang('members.comments.post')?>: <?=html::anchor($post_url, $post)?>
				</SPAN>
			</DT>
			<DD>
				<?=$comment->text?>
			</DD>
		</DL>
	</LI>
	<?endforeach;?>
</UL>